package com.insta.PolyInterfaces;

import java.util.*;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Sebastien
 */
public class Program
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        ArrayList<ISpeeder> list = new ArrayList<ISpeeder>();
        
        list.add(new Aston());
        list.add(new Mercedes());
        list.add(new Clio());
        list.add(new Human());
        
        for( ISpeeder speeder : list)
        {
            speeder.Accelerate();
            
            System.out.println( speeder.getClass().getSimpleName() +  " : " + speeder.getActualSpeed());
            
            if (speeder instanceof Mercedes)
            {
                Mercedes MaBenz = (Mercedes)speeder;
                
                System.out.println( MaBenz.Ignition());
            }            
        }       
    }
    
    
    
}
